﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Castle.Windsor;
using Castle.Windsor.Configuration.Interpreters;

namespace Model.Common
{
    /// <summary>
    /// Ioc容器，默认从Web.Config配置节点中加载
    /// </summary>
    public class IocContainer : WindsorContainer
    {
        /// <summary>
        /// 默认构造函数：从Web.Config配置节点中加载
        /// </summary>
        public IocContainer()
            : base(new XmlInterpreter())
        {
        }

        /// <summary>
        /// 从配置文件中加载
        /// </summary>
        /// <param name="xmlFile">指定xml文件</param>
        public IocContainer(string xmlFile)
            : base(new XmlInterpreter(xmlFile))
        {
        }
    }
}
